package com.hp.airmap.common;

import android.content.Context;
import android.text.TextUtils;
import android.widget.ImageView;

import com.hp.airmap.R;
import com.squareup.picasso.Picasso;

/**
 * Created by 23hp on 2016/7/4.
 * Picasso图片加载模块
 */
public class ImgLoader {
    public static void with(Context context, String imageUrl, ImageView imageView) {
        if (!TextUtils.isEmpty(imageUrl)){
             Picasso.with(context).load(imageUrl).placeholder(R.drawable.img).fit().into(imageView);
        }
    }

    public static void with(Context context, String imageUrl,int errorImgId, ImageView imageView) {
        if (!TextUtils.isEmpty(imageUrl)){
            Picasso.with(context).load(imageUrl).placeholder(errorImgId).fit().into(imageView);
        }
    }

}
